***
Readme

Date: 16-Nov-2022

Title: "Ethnic Inequality, Democratic Transitions, and Democratic  Breakdowns: Investigating an Asymmetrical Relationship"

Contact: Lasse Egendal Leipziger - lel@ps.au.dk

This file contains an overview of the replication material for the article and the appendix. 


The empirical analysis primarily relies on the dataset “Main dataset.dta”. This dataset has been merged based on a number of datasets listed below.
These datasets are all provided in the folder “Merging of dataset”, which includes a Stata do-file "Do-file for merging datasets" that 
replicates the merging of "Main dataset". This step is also documented with the log file "log_merge".

- 	“Lexical Index v6.0.dta” (Lexical Index of Electoral Democracy by Skaaning et al. – main democracy measure used)
-	"V-Dem-CY-Full+Others-v11.1.dta" (V-Dem full dataset version 11.1, ethnic inequality measure and several variables for mechanism test)
-	“Fariss et al - Estimates_all_long_210911.dta” (GDP pc. data for longer time series)
-	”Omoeva et al. EICC_dataset.dta” (alternative ethnic inequality measure)
-	”Cederman et al. (2015). jpr_triangulation_repdata.dta” (alternative ethnic inequality measure)
-	”Cederman et al. 2013. repdata_ch7.dta” (alternative ethnic inequality measure)
-	”EPR_country.dta” (Ethnic Power Relations 2020 data for supplementary analysis)
-	“Houle 2015 - Country Data.dta” (alternative ethnic inequality measure)
-	“NAVCO v2.0.dta” (mobilization data for mechanism study)
-	”spmap_30_09_2021.dta” (files needed to reproduce map)
-	”Alesina et al. 2016. EI_final_JPE.dta” (various ethnic diversity measures and one alternative ethnic inequality measure)
-	”SWIID 9.1.dta” (Non-ethnic income inequality for supplementary analysis)
-	”BTI_2006-2022.dta” (Bertelsmann transformation index data for supplementary analysis)

One supplementary analysis also relies on group-level data from the separate dataset “AMAR dataset for analysis”. Two country-level variables 
from the main dataset have been merged into the original AMAR data. A do-file can be found in the “Preparation of AMAR dataset” 
subfolder, which replicates this process. This is also documented with the log file "log_merge_AMAR".

The file "Codebook.pdf" has more information on each dataset and all the included variables.

The Stata do-file "Do-file for analysis" recodes the data and produces all the results presented in the article and the appendix.

The file "log_ethnic_ineq_reg.pdf" is a log file showing the running of the replication files.

The file "worldcoor.dta"must be in the same folder as the do-file for a sucessful creation of Figure A1.

All analyses were done using: StataSE 16.0

Platform: Windows 10 Education 64-bit

Estimated runtime is under 30 minutes.

*** 
Date: 7-Oct-2024

In an erratum for the article, I describe a recoding mistake related to a variable appearing in Figure 6 and Tables A1 and A10. Corrected versions of the do-file and appendix have been uploaded to the replication data folder: "Do-file for analysis (updated)" and "Appendix - Ethnic Inequality and Regime Change (updated)".